from fastapi import FastAPI, Response, Request
from app.activity import activity, goods, lottery, questionnaire, statistics, vote, winning

from core.config import get_setting

app = FastAPI()

from .middleware import *


def init_app():
    # 中间件 - CORS

    # ----------- app -----------------
    for item in [activity, goods, lottery, questionnaire, statistics, vote, winning]:
        app.include_router(
            item.router,
            prefix="/activity"
        )


@app.get("/", tags=["index"])
def index():
    return Response("welcome ")


init_app()
